import { defineStore } from 'pinia'
import { getAllLand } from '../api/farmer/land'
import { data, LandInfoData } from '../types/land'

export const useGetAllLandStore = defineStore('land', {
    state: () => ({
        landInfo: {
            data: {
                total: '',
                records: []
            },
            code: 0,
            msg: ''
        } as data
    }),
    actions: {
        async fetchLandInfo(params: any) {
            this.landInfo = await getAllLand(params)
            console.log('土地信息', this.landInfo)
        }
    }
})